 import {mapGetters} from 'vuex'
  export default {
   
    computed:{
      ...mapGetters('m_cart',['total'])
    },
    watch:{
      total:{
        handler(newVal){
          this.setBadge(newVal)
        },
        immediate:true
      }
    },
    onShow(){
      this.setBadge()
    },
    methods:{
      setBadge(a){
        uni.setTabBarBadge({
          index:2,
          text:this.total+''||a
        })
      }
    }
  }